package com.android.measuringimportanceoflectureslides.data;

import com.android.measuringimportanceoflectureslides.R;

import android.app.Activity;
import android.app.ListActivity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class SimpleList extends ListActivity{
	
	private ArrayAdapter<String> adapter = null;
	private Context mContext;
	private ListView listView;
	
	public SimpleList (Context context, ListView listview){
		this.mContext = context;
		this.listView = listview;
	}
	
	public void createList(){
		
		//sets the view of list
		
		// First paramenter - Context
		// Second parameter - Layout for the row
		// Third parameter - ID of the TextView to which the data is written
		// Forth - the Array of data
		adapter = new ArrayAdapter<String>(mContext,
				android.R.layout.simple_list_item_1, 
				R.id.lst_menu_captured_slides);
		
		// Assign adapter to ListView
		listView.setAdapter(adapter);
	}
	
	public void fillList(String fileName){
		adapter.add(fileName);
	}

	public ArrayAdapter<String> getAdapter() {
		return adapter;
	}

	public void setAdapter(ArrayAdapter<String> adapter) {
		this.adapter = adapter;
	}
}
